// 处理多次点击
function throttle(fn, params) {
  console.log(fn)
  const that = this
  if (that.onoff && fn) {
    that.onoff = false
    if (params) {
      fn(params)
    } else {
      fn()
    }
    setTimeout(function() {
      that.onoff = true
    }, 1500)
  } else {
    console.log('请稍后点击')
  }
}
export { throttle }
